package cn.northsea.mapper;

import cn.northsea.pojo.WarehouseProduct;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SaleMapper {

    @Select("select * from erp_warehouse_product where product_id = #{value}")
    List<WarehouseProduct> findWarehouseProductByPid(Integer productId);

    @Update("update erp_warehouse_product set warehouse_product_quantity " +
            "=#{zNum} where product_id=#{productId} and warehouse_id = #{warehouseId}")
    void update(@Param("productId") Integer productId, @Param("zNum") Integer zNum, @Param("warehouseId") Integer warehouseId);
}
